package com.xinsilu.ceshi.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/redis")
public class RedisContriller {

    @Autowired
    private StringRedisTemplate redisTemplate;


    @RequestMapping("/setStr")
    public Object setStr(String key, String value) {

        redisTemplate.opsForValue().set(key, value);
//        redisTemplate.opsForHash();
//        redisTemplate.opsForList();
//        redisTemplate.opsForSet();
//        redisTemplate.opsForZSet();

        return "ok";
    }


}
